package com.cn.producer;

import com.cn.client.TopicPublishInfo;
import com.cn.file.MessageStore;
import com.cn.msg.Message;

public interface Producer {

    void start() throws InterruptedException;

    void stop();

    /**
     * 发送消息
     *
     * @param messageStore
     * @return
     */
    SendResult send(MessageStore messageStore);

    /**
     * 发送消息
     *
     * @param messageStore
     * @param timeout
     * @return
     */
    SendResult send(MessageStore messageStore, long timeout);

    SendResult invokeMsg(Message message, String addr);

    /**
     * @param topicPublishInfo
     */
    void updateTopicPublishInfo(String topic, TopicPublishInfo topicPublishInfo);

}
